package com.example.applications.Kotlin

import android.widget.Button

fun main() {

    var student1 = student(1)

    student1.name = "小王"
    student1.printID()

    var student2 = student("2")
    student2.name = "大王"
    student2.printID()

}


class student<T>(var ID: T) {
    var name: String = ""
    lateinit var button: Button // 延迟初始化构造函数外部的非 null 属性
    fun printID() {
        println("姓名：$name，学号：$ID")
    }
}
